/*****************************************************************************
 *   type.h:  Type definition Header file for NXP LPC230x Family 
 *   Microprocessors
 *
 *   Copyright(C) 2006, NXP Semiconductor
 *   All rights reserved.
 *
 *   History
 *   2006.09.01  ver 1.00    Prelimnary version, first Release
 *
******************************************************************************/
#ifndef __TYPE_H__
#define __TYPE_H__


#ifndef NULL
#define NULL    ((void *)0)
#endif

#ifndef FALSE
#define FALSE   (0)
#endif

#ifndef TRUE
#define TRUE    (1)
#endif

typedef unsigned char  BYTE;
typedef unsigned short WORD;
typedef unsigned long  DWORD;
typedef unsigned int   BOOL;

#define LED_on()	FIO3SETU = 0x1000;
#define LED_off()   FIO3CLRU = 0x1000;
#define JAM_pressed() (FIO3PIN2 & (1 << 6))

/* Integer.h */
/* modified by Martin Thomas to avoid redefiniton
   for BYTE, WORD and DWORD */

/* These types are assumed as 16-bit or larger integer */
typedef signed int		INT;
typedef unsigned int	UINT;

/* These types are assumed as 8-bit integer */
typedef signed char		CHAR;
typedef unsigned char	UCHAR;
#ifndef BYTE_TYPEDEF
#define BYTE_TYPEDEFED
//typedef unsigned char	BYTE;
#endif

/* These types are assumed as 16-bit integer */
typedef signed short	SHORT;
typedef unsigned short	USHORT;
#ifndef WORD_TYPEDEF
#define WORD_TYPEDEF
//typedef unsigned short	WORD;
#endif

/* These types are assumed as 32-bit integer */
typedef signed long		LONG;
typedef unsigned long	ULONG;
#ifndef DWORD_TYPEDEF
#define DWORD_TYPEDEF
//typedef unsigned long	DWORD;
#endif

#if 1
// mthomas
#ifndef FALSE
typedef enum { FALSE = 0, TRUE } BOOL;
#endif
#else
/* Boolean type */
typedef enum { FALSE = 0, TRUE } BOOL;
#endif

#define _INTEGER

#endif  /* __TYPE_H__ */
